package day05;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo02 {
    public static void main(String[] args) {
        /*
         * 使用线程执行没有返回值的线程
         */
        //创建了数量为3的线程池
        ExecutorService pool=
            Executors.newFixedThreadPool(3);
        //execute 执行没有返回值的线程
        pool.execute(()-> System.out.println(Thread.currentThread()));
        pool.execute(()-> System.out.println(Thread.currentThread()));
        pool.execute(()-> System.out.println(Thread.currentThread()));
        pool.execute(()-> System.out.println(Thread.currentThread()));
        pool.execute(()-> System.out.println(Thread.currentThread()));
        pool.execute(()-> System.out.println(Thread.currentThread()));
    }
}
